﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace ProjectM2Work.Pages
{
    public partial class PageBaiGiang : PhoneApplicationPage
    {
        bool isScale = false;
        public PageBaiGiang()
        {
            InitializeComponent();
           // this.Width;
        }

        private void image2_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {
            //vao chuong 1:
            NavigationService.Navigate(new Uri("/Pages/PageChuong01.xaml", UriKind.Relative));
        }

        private void image2_MouseMove(object sender, MouseEventArgs e)
        {
            if (isScale == false)
            {
                btn_chuong1.Height = btn_chuong1.ActualHeight * 1.1f;
                btn_chuong1.Width = btn_chuong1.ActualWidth * 1.1f;
                isScale = true;
            }
        }

        private void btn_chuong1_MouseLeave(object sender, MouseEventArgs e)
        {
            if (isScale == true)
            {
                btn_chuong1.Height = btn_chuong1.ActualHeight / 1.1f;
                btn_chuong1.Width = btn_chuong1.ActualWidth / 1.1f;
                isScale = false;
            }
        }

        private void btn_chuong2_MouseMove(object sender, MouseEventArgs e)
        {
            if (isScale == false)
            {
                btn_chuong2.Height = btn_chuong2.ActualHeight * 1.1f;
                btn_chuong2.Width = btn_chuong2.ActualWidth * 1.1f;
                isScale = true;
            }
        }

        private void btn_chuong2_MouseLeave(object sender, MouseEventArgs e)
        {
            if (isScale == true)
            {
                btn_chuong2.Height = btn_chuong2.ActualHeight / 1.1f;
                btn_chuong2.Width = btn_chuong2.ActualWidth / 1.1f;
                isScale = false;
            }
        }

        private void btn_chuong3_MouseMove(object sender, MouseEventArgs e)
        {
            if (isScale == false)
            {
                btn_chuong3.Height = btn_chuong3.ActualHeight * 1.1f;
                btn_chuong3.Width = btn_chuong3.ActualWidth * 1.1f;
                isScale = true;
            }
        }

        private void btn_chuong3_MouseLeave(object sender, MouseEventArgs e)
        {
            if (isScale == true)
            {
                btn_chuong3.Height = btn_chuong3.ActualHeight / 1.1f;
                btn_chuong3.Width = btn_chuong3.ActualWidth / 1.1f;
                isScale = false;
            }
        }

        private void btn_chuong1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (isScale == false)
            {
                btn_chuong1.Height = btn_chuong1.ActualHeight * 1.1f;
                btn_chuong1.Width = btn_chuong1.ActualWidth * 1.1f;
                isScale = true;
            }
        }

        private void btn_chuong2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (isScale == false)
            {
                btn_chuong2.Height = btn_chuong2.ActualHeight * 1.1f;
                btn_chuong2.Width = btn_chuong2.ActualWidth * 1.1f;
                isScale = true;
            }
        }

        private void btn_chuong3_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (isScale == false)
            {
                btn_chuong3.Height = btn_chuong3.ActualHeight * 1.1f;
                btn_chuong3.Width = btn_chuong3.ActualWidth * 1.1f;
                isScale = true;
            }
        }

      

        private void btn_chuong2_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Pages/PageChuong02.xaml", UriKind.Relative));
        }

        private void btn_chuong3_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Pages/PageBaiGiang.xaml", UriKind.Relative));
        }

        private void btn_chuong1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Pages/PageChuong01.xaml", UriKind.Relative));
        }

        private void btn_chuong2_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Pages/PageChuong02.xaml", UriKind.Relative));
        }

        private void btn_chuong3_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Pages/PageChuong03.xaml", UriKind.Relative));
        }

        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            if (NavigationService.CanGoBack)
            {
                NavigationService.GoBack();
            }
        }

        private void image2_MouseMove_1(object sender, MouseEventArgs e)
        {
            App.ZoomOutImage(sender);
        }

        private void image2_MouseLeave(object sender, MouseEventArgs e)
        {
            App.ZoomInImage(sender);
        }

        private void image2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            App.ZoomOutImage(sender);
        }

        private void image2_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }

        private void image2_MouseLeave_1(object sender, MouseEventArgs e)
        {
            App.ZoomInImage(sender);
        }

        private void image2_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
        {
            App.ZoomOutImage(sender);
        }

        private void image2_MouseMove_2(object sender, MouseEventArgs e)
        {
            App.ZoomOutImage(sender);
        }

        private void image2_MouseLeftButtonUp_1(object sender, MouseButtonEventArgs e)
        {
            NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }
    }
}